home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / tracker-4.13.lha / tracker / song.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  3.2 KB  |  150 lines

  1. /* song.h 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* internal data structures for the soundtracker player routine....
  6.  */
  7.  
  8. /* $Id: song.h,v 4.7 1995/02/14 04:02:28 espie Exp $
  9.  * $Log: song.h,v $
  10.  * Revision 4.7  1995/02/14  04:02:28  espie
  11.  * Nothing.
  12.  *
  13.  * Revision 4.7  1995/02/14  04:02:28  espie
  14.  * Nothing.
  15.  *
  16.  * Revision 4.6  1995/02/06  14:50:47  espie
  17.  * Changed sample_info.
  18.  *
  19.  * Revision 4.6  1995/02/06  14:50:47  espie
  20.  * Changed sample_info.
  21.  *
  22.  * Revision 4.5  1995/02/01  17:14:54  espie
  23.  * Scaled volume.
  24.  *
  25.  * Revision 4.5  1995/02/01  17:14:54  espie
  26.  * Scaled volume.
  27.  *
  28.  * Revision 4.4  1995/02/01  16:39:04  espie
  29.  * *** empty log message ***
  30.  *
  31.  * Revision 4.0  1994/01/11  17:55:59  espie
  32.  * REAL_MAX_PITCH for better player.
  33.  * REAL_MAX_PITCH != MAX_PITCH.
  34.  * Added samples_start.
  35.  *
  36.  * Revision 2.5  1992/10/31  11:18:00  espie
  37.  * New fields for optimized resampling.
  38.  * Exchanged __ANSI__ to SIGNED #define.
  39.  */
  40.  
  41. #ifdef SIGNED
  42. typedef signed char SAMPLE;
  43. #else
  44. typedef char SAMPLE;
  45. #endif
  46.  
  47. #define NUMBER_SAMPLES 32
  48.  
  49. #define BLOCK_LENGTH 64
  50. #define NUMBER_TRACKS 4
  51. #define NUMBER_PATTERNS 128
  52.  
  53. #define NUMBER_EFFECTS 40
  54.  
  55. /* some effects names */
  56. #define EFF_ARPEGGIO    0
  57. #define EFF_DOWN        1
  58. #define EFF_UP          2
  59. #define EFF_PORTA       3
  60. #define EFF_VIBRATO     4
  61. #define EFF_PORTASLIDE  5
  62. #define EFF_VIBSLIDE    6
  63. #define EFF_OFFSET      9
  64. #define EFF_VOLSLIDE    10
  65. #define EFF_FF          11
  66. #define EFF_VOLUME      12
  67. #define EFF_SKIP        13
  68. #define EFF_EXTENDED    14
  69. #define EFF_SPEED       15
  70. #define EFF_NONE        16
  71. #define EXT_BASE        16
  72. #define EFF_SMOOTH_UP   (EXT_BASE + 1)
  73. #define EFF_SMOOTH_DOWN (EXT_BASE + 2)
  74. #define EFF_CHG_FTUNE   (EXT_BASE + 5)
  75. #define EFF_LOOP        (EXT_BASE + 6)
  76. #define EFF_RETRIG      (EXT_BASE + 9)
  77. #define EFF_S_UPVOL     (EXT_BASE + 10)
  78. #define EFF_S_DOWNVOL   (EXT_BASE + 11)
  79. #define EFF_NOTECUT     (EXT_BASE + 12)
  80. #define EFF_LATESTART   (EXT_BASE + 13)
  81. #define EFF_DELAY       (EXT_BASE + 14)
  82.  
  83. #define SAMPLENAME_MAXLENGTH 22
  84. #define TITLE_MAXLENGTH 20
  85.  
  86. #define MIN_PITCH 113
  87. #define MAX_PITCH 856
  88. #define REAL_MAX_PITCH 1050
  89.  
  90. #define MIN_VOLUME 0
  91. #define MAX_VOLUME 64
  92.  
  93. /* the fuzz in note pitch */
  94. #define FUZZ 2
  95.  
  96. /* we refuse to allocate more than 500000 bytes for one sample */
  97. #define MAX_SAMPLE_LENGTH 500000
  98.  
  99. struct sample_info
  100.    {
  101.    char *name;
  102.    int  length, rp_offset, rp_length;
  103.    unsigned long  fix_length, fix_rp_length;
  104.    int volume;
  105.     int volume_lookup[MAX_VOLUME+1];
  106.     int color;
  107.    int finetune;
  108.    SAMPLE *start, *rp_start;
  109.    };
  110.  
  111. /* the actual parameters may be split in two halves occasionnally */
  112.  
  113. #define LOW(para) ((para) & 15)
  114. #define HI(para) ((para) >> 4)
  115.  
  116. struct event
  117.    {
  118.    unsigned char sample_number;
  119.    unsigned char effect;
  120.    unsigned char parameters;
  121.    unsigned char note;
  122.    int pitch;
  123.    };
  124.  
  125. struct block
  126.    {
  127.    struct event e[NUMBER_TRACKS][BLOCK_LENGTH];
  128.    };
  129.     
  130.         
  131. struct song_info
  132.    {
  133.    int length;
  134.    int maxpat;
  135.    int transpose;
  136.    char patnumber[NUMBER_PATTERNS];
  137.    struct block *pblocks;
  138.    };
  139.  
  140. struct song
  141.    {
  142.    char *title;
  143.       /* sample 0 is always a dummy sample */
  144.    struct sample_info *samples[NUMBER_SAMPLES];
  145.    struct song_info info;
  146.    long samples_start;
  147.    };
  148.  
  149. #define AMIGA_CLOCKFREQ 3575872
  150.